import Vue from 'vue' // 导入vue
import App from './App.vue' // 导入App模板
import router from './router' // 导入路由
import './plugins/element.js'
import './assets/css/global.css'
import './assets/fonts/iconfont.css' // 导入第三方icon
import axios from 'axios'

Vue.config.productionTip = false
axios.defaults.baseURL = 'https://www.fastmock.site/mock/939d07b84317f59af723d55c64a99173/shop' // 设置根url

axios.interceptors.request.use(config => {
  config.headers.token = window.sessionStorage.getItem('token')
  return config
})

Vue.prototype.$http = axios // 挂在axios

new Vue({
  router, // 这个是router:router的简写
  render: h => h(App) // 字符串模板的代替方案 是
  /* render: function (createElement) {
    return createElement(App)
  }
  的简写
  */
}).$mount('#app')
